﻿namespace WatiN.Extensions
{
    using global::WatiN.Core;

    public static class RadioButtonCollectionExtensions
    {
        public static bool Exists(this RadioButtonCollection radioButtonCollection, string radioButtonIdOrNameOrValueorClass, bool extension = true)
        {
            return radioButtonCollection.Exists(Find.ById(radioButtonIdOrNameOrValueorClass)) ||
                radioButtonCollection.Exists(Find.ByName(radioButtonIdOrNameOrValueorClass)) ||
                radioButtonCollection.Exists(Find.ByValue(radioButtonIdOrNameOrValueorClass)) ||
                radioButtonCollection.Exists(Find.ByClass(radioButtonIdOrNameOrValueorClass)) ||
                radioButtonCollection.Exists(Find.ByLabelText(radioButtonIdOrNameOrValueorClass));
        }
    }
}
